home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / zendisk1.zip / LST10-10.ASM < prev    next >
Assembly Source File  |  1990-02-15  |  520b  |  24 lines

  1. ;
  2. ; *** Listing 10-10 ***
  3. ;
  4. ; Sets every element of a 1000-byte array to 1 by
  5. ; repeating STOSW 500 times.
  6. ;
  7.     jmp    Skip
  8. ;
  9. ARRAY_LENGTH    equ    1000
  10. WordArray    db    ARRAY_LENGTH dup (?)
  11. ;
  12. Skip:
  13.     call    ZTimerOn
  14.     mov    di,seg WordArray
  15.     mov    es,di    ;point ES:DI to the array to fill
  16.     mov    di,offset WordArray
  17.     mov    ax,(1 shl 8) + 1
  18.             ;fill each byte with the value 1
  19.     mov    cx,ARRAY_LENGTH/2 ;# of words to fill
  20.     cld        ;make STOSW add 2 to DI on each
  21.             ; execution
  22.     rep    stosw    ;fill a word at a time
  23.     call    ZTimerOff
  24.